/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package view.GUI.popup;

import java.io.Serializable;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import view.GUI.LabelReader;
import view.GUI.sidepanels.Palette;
import view.GUI.sidepanels.PaletteItem;
import view.GUI.actions.DeletePaletteItemAction;

/**
 *
 * @author Jelle
 */
public class PalettePopup implements IPopup, Serializable {
    private JPopupMenu popup = new JPopupMenu();
    private JMenuItem m;
    private Palette palette;
    private PaletteItem pi;

    public PalettePopup() {  }
    
    public void menuPanel() {
        m = new JMenuItem(new DeletePaletteItemAction(palette, pi));
        m.setText(LabelReader.getInstance().getString("DeletePaletteItem"));
        popup.add(m);
    }

    public JPopupMenu getPopup(){
        return popup;
    }

    /**
     * @param palette the palette to set
     */
    public void setPalette(Palette palette) {
        this.palette = palette;
    }

    /**
     * @param pi the pi to set
     */
    public void setPi(PaletteItem pi) {
        this.pi = pi;
    }
}
